home *** CD-ROM | disk | FTP | other *** search
/ MacWorld UK 2000 March / MW_UK_2000_03.iso / Shareware World / Utilities / Text Processing / Alpha / Tcl / SystemCode / BackCompatibility.tcl < prev    next >
Encoding:
Text File  |  1999-11-02  |  4.1 KB  |  113 lines  |  [TEXT/ALFA]

  1. # You should avoid calling any of these procs:
  2. # They are slower, and may be removed at some point in the future.
  3. # Some of these are currently called from Alpha's main menus.  This
  4. # will be changed in the future, so that this entire file can vanish.
  5.  
  6. # just wrappers around other procs
  7.  
  8. proc pushMark {} {pushPosition}
  9. proc popMark {} {popPosition}
  10. proc pushPosition {args} {uplevel placeBookmark $args}
  11. proc popPosition {args} {uplevel returnToBookmark $args}
  12. proc absolutePath {filename} {file::absolutePath $filename}
  13. proc openFileQuietly {filename} {
  14.     edit -c -w $filename
  15. }
  16. proc searchInFile {filename searchString {indices 0}} {
  17.     file::searchFor $filename $searchString $indices
  18. }
  19.  
  20. proc readFile {fileName} {file::readAll $fileName}
  21. proc writeFile {filename {text {}} {overwrite 0}} {
  22.     file::writeAll $filename $text $overwrite
  23. }
  24. proc gotoFileLine {fname line {mesg {}}} {
  25.     file::gotoLine $fname $line $mesg
  26. }
  27.  
  28. proc buildSubMenu {args} {
  29.     eval menu::buildHierarchy $args
  30. }
  31.  
  32. proc listSubfolders {folder {depth 3}} {
  33.     file::hierarchy $folder $depth
  34. }
  35.  
  36. proc getIncludeFiles {} { optClickTB_List }
  37. proc editIncludeFile {item} { optClickTB_Pick $item}
  38. proc tryElseDump {name script} {
  39.     try::level \#0 $script -reporting log -while $name
  40. }
  41. proc text::genericIndent {} { ::indentLine }
  42.  
  43. proc revertTheseFiles {flist} {eval file::revertThese $flist}
  44.  
  45. proc file::commentTextBlock {args} { eval comment::TextBlock $args }
  46. proc commentLine  {args} { uplevel 1 comment::Line $args }
  47. proc uncommentLine  {args} { uplevel 1 comment::undoLine $args }
  48. proc commentBox  {args} { uplevel 1 comment::Box $args }
  49. proc uncommentBox  {args} { uplevel 1 comment::undoBox $args }
  50. proc commentCharacters {args} { uplevel 1 comment::Characters $args }
  51. proc commentGetRegion  {args} { uplevel 1 comment::GetRegion $args }
  52. proc commentSameStart  {args} { uplevel 1 comment::SameStart $args }
  53. proc commentTextBlock  {args} { uplevel 1 comment::TextBlock $args }
  54. proc commentGetFillLines {args} { uplevel 1 comment::GetFillLines $args }
  55. proc commentParagraph  {args} { uplevel 1 comment::Paragraph $args }
  56. proc uncommentParagraph {args} { uplevel 1 comment::undoParagraph $args }
  57. proc fillParagraph {args} {uplevel 1 paragraph::fill $args}
  58. proc fillOneParagraph {args} {uplevel 1 paragraph::fillOne $args}
  59. proc paraStart {args} {uplevel 1 paragraph::start $args}
  60. proc paraFinish {args} {uplevel 1 paragraph::finish $args}
  61. proc sentenceParagraph {args} {uplevel 1 paragraph::sentence $args}
  62. proc selectParagraph {args} {uplevel 1 paragraph::select $args}
  63. proc addArrDef {args} { uplevel 1 prefs::addArrayElement $args }
  64. proc removeArrDef {args} { uplevel 1 prefs::removeArrayElement $args }
  65. proc addDef {args} {uplevel 1 prefs::add $args}
  66. proc removeDef {args} {uplevel 1 prefs::remove $args}
  67. proc readDefs {args} {uplevel 1 prefs::_read $args}
  68. proc writeDefs {args} {uplevel 1 prefs::_write $args}
  69. proc addArr {args} { uplevel 1 prefs::addArray $args }
  70. proc removeArr {args} { uplevel 1 prefs::removeArray $args }
  71. proc saveModifiedVars {args} { uplevel 1 prefs::saveModified $args }
  72. proc alpha::readUserDefs {} {uplevel 1 prefs::readAll}
  73. proc alpha::readUserPrefs {} {uplevel 1 prefs::tclRead}
  74. proc addUserLine {args} { uplevel 1 prefs::tclAddLine $args}
  75. namespace eval mode {}
  76. proc mode::addUserLine {args} {uplevel 1 prefs::tclAddModeLine $args}
  77. proc getSavedSettings {} {prefs::listAllSaved}
  78. proc removeSavedSetting {} {prefs::removeSavedSetting}
  79. proc viewSavedSetting {} {prefs::viewSavedSetting}
  80.  
  81.  
  82. proc upBrowse {} { browse::Up }
  83. proc downBrowse {} { browse::Down }
  84. proc gotoMatch {} { browse::Goto }
  85.  
  86. ########################################
  87. #                           #
  88. #    A few random lisp'ish functions.  #
  89. #                       #
  90. ########################################
  91.  
  92. proc car {l} {lindex $l 0}
  93. proc cadr {l} {lindex $l 1}
  94. proc caddr {l} {lindex $l 2}
  95. proc cadddr {l} {lindex $l 3}
  96. proc caddddr {l} {lindex $l 4}
  97. proc cdr {l} {lrange $l 1 end}
  98. proc cddr {l} {lrange $l 2 end}
  99.  
  100. proc mapcar args {return [eval map $args]}
  101.  
  102. proc map {func l} {
  103.     set out {}
  104.     foreach el $l {
  105.     lappend out [eval $func [list $el]]
  106.     }
  107.     return $out
  108. }
  109.  
  110. proc cons {e l} {concat [list $e] $l}
  111.  
  112.